<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/6/10
  Time: 12:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        *{margin: 0;padding: 0;}
        a{
            text-decoration: none;
            color: #666;
        }
        input{
            outline: none;
        }
        .w{
            width: 1000px;
            margin: 0 auto;
        }
        .header{
            overflow: hidden;
            height: 120px;
        }
        .header h1{
            font-size: 0px;
        }
        .header a{
            display: block;
            margin-top: 10px;
        }
        .header img{
            height: 100px;
        }
        .login_war{
            height: 475px;
            background-color: #E93854;
        }
        .core{
            position: relative;
            height:100% ;
            background: url(images/login_bg.jpg) no-repeat;
        }
        .login{
            position: absolute;
            top: 20px;
            right: 0;
            width: 350px;
            height: 400px;
            background-color: #FFFFFF;
        }
        .top{
            display: flex;
            color: #666;
            height: 50px;
            border-bottom: 2px solid #F4F4F4;
        }
        .top_left,.top_right{
            flex:1;
            font-weight: 400;
            line-height: 50px;
            font-size: 20px;
            text-align: center;
            height: 100%;
        }
        .top_left a:hover,.top_right a:hover{
            font-weight: 700;
            color: #E4393C;
        }
        .form{
            margin-top: 40px;
            height: 192px;
        }
        .form_user,.form_pwd{
            position: relative;
            width: 306px;
            margin: 20px auto;
            height: 38px;
             border: 1px solid #ccc;
            /*border: 1px solid #e85356;*/
        }
        .form_user label,.form_pwd label{
            position: absolute;
            top: 0;
            left: 0;
            z-index: 3;
            width: 38px;
            height: 38px;
            border-right: 1px solid #bdbdbd;
        }
        .form_user label{
            background: url(images/sprite.png) no-repeat;
        }
        .form_user .usererr{
            background: url(images/sprite.png) no-repeat 0 -96px;
            border-right: 1px solid #ccc;
        }
        .form_pwd label{
            background: url(images/sprite.png) no-repeat -48px 0;
        }
        .form_pwd .pwderr{
            background: url(images/sprite.png) no-repeat -48px -96px;
            border-right: 1px solid #ccc;
        }
        .form_user input,.form_pwd input{
            border: 0px;
            padding-left: 50px;
            box-sizing: border-box;
            width: 304px;
            height: 38px;
        }
        .wpwd{
            display: block;
            padding: 20px 20px;
            box-sizing: border-box;
            width: 100%;
            font-size: 14px;
            text-align: right;
        }
        .form_submit{
            text-align: center;

        }
        .form_submit a{
            border: 1px solid #e85356;
            margin: 0 auto;
            display: block;
            width: 302px;
            background: #e4393c;
            height: 31px;
            line-height: 31px;
            color: #fff;
            font-size: 20px;
            font-family: 'Microsoft YaHei';
        }
        .fot{
            width: 100%;
            position: absolute;
            display: flex;
            bottom: 0;
            padding: 0 20px;
            box-sizing: border-box;
            height: 50px;
            line-height: 50px;
            border-top: 1px solid #f4f4f4;
            height: auto;
            background-color: #fcfcfc;
        }
        .fot .qq,.fot .wx{
            flex: 1;
            font-size: 12px;
        }
        .qq a:hover,.wx a:hover{
            color: #e4393c;
        }
        .qq b,.wx b{
            width: 19px;
            height: 18px;
            display: block;
            margin-top: 16px;
            float: left;
        }
        .qq span,.wx span{
            padding-left: 5px;
        }
        .qq b{
            background: url(images/QQ-weixin.png) no-repeat;
        }
        .wx b{
            background: url(images/QQ-weixin.png) no-repeat -19px 0;
        }
        .fot .reg{
            text-align: right;
            flex: 2;
        }
        .line{
            margin-left: -20px;
            padding-right: 16px;
            color: #ccc;
        }
        .reg a{
            font-size: 14px;
            color:#E4393C;
        }
        .line1{
            color: #ccc;
            line-height: 50px;
        }
        .footer{
            text-align: center;
            color: #666;
            font-size: 14px;
        }
        .erweima img{
            display: block;
            width: 147px;
            height: 147px;
        }
        .img_box{
            width: 170px;
            height: 160px;
            display: flex;
            justify-content: center;
            align-items: center;
            border: 1px solid #ccc;
            margin: 20px auto;
        }
    </style>
    <script src="js/jquery.min.js"></script>
    <script>
        $(function(){
            $("#button").click(function(){
                $.post("user/login",$("#loginForm").serialize(),function(data){
                    if(data.flag){
                        location.href="/index.jsp"
                    }else{
                        $("#errorMsg").html(data.errorMsg);
                    }
                })
            })
            $("#saoma").click(function(){
                $("#loginbox").hide();
                $("#erweima").show();
            })
            $("#zhanghu").click(function () {
                $("#loginbox").show();
                $("#erweima").hide();
            })
        })
    </script>
</head>
<body>
<header class="header w">
    <h1>芝麻优购
        <a><img src="images/logo.png" alt=""></a>
    </h1>
</header>
<div class="login_war">
    <div class="core w">
        <div class="login">
            <div class="top">
                <div class="top_left"><a href="javascript:;" id="saoma">扫码登陆</a></div>
                <div class="line1">|</div>
                <div class="top_right"><a href="javascript:;" id="zhanghu">账户登录</a></div>
            </div>
            <div class="form" id="loginbox">
                <!--登录错误提示消息-->
                <div id="errorMsg" class="alert alert-danger" ></div>
                <form action="" id="loginForm">
                    <div class="form_user">
                        <label for="username"> </label><input type="text" id="username" name="username" placeholder="邮箱/用户名/手机号">
                    </div>
                    <div class="form_pwd">
                        <label  for="password"></label><input type="password" id="password" name="password" placeholder="密码">
                    </div>
                    <a class="wpwd" href="javascript:;">忘记密码</a>
                    <div class="form_submit">
                        <a href="javascript:;" id="button">登&nbsp;&nbsp;&nbsp;&nbsp;陆</a>
                    </div>
                </form>
            </div>
            <div class="erweima"  id="erweima" style="display: none">
                <div class="img_box">
                    <img src="images/erweima.jpg" alt="">
                </div>
                <p style="text-align: center;">打开 <span style="color: #E4393C;">微信</span> 扫描二维码</p>

            </div>
            <div class="fot">
                <div class="qq"><a href="">
                    <b></b>
                    <span>QQ</span>
                </a></div>
                <span class="line">|</span>
                <div class="wx"><a href="">
                    <b></b>
                    <span>微信</span>
                </a>
                </div>
                <div class="reg">
                    <a href="/regist.jsp">立即注册</a>
                </div>
            </div>
        </div>
    </div>
</div>
<footer class="footer w">
    <p style="margin: 20px 0;"> 关于我们 | 联系我们 | 人才招聘 | 商家入驻 | 广告服务 | 手机芝麻 | 友情链接 | 销售联盟 | 芝麻社区 | 芝麻公益 | English Site</p>
    <p> Copyright © 2020-2020  芝麻ZM.com 版权所有</p>
</footer>
</body>
</html>
